package cn.yanjr.mall.action;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSON;

import cn.yanjr.common.bean.Services;
import cn.yanjr.common.web.BaseServlet;
import cn.yanjr.mall.mall_base.service.SysDictService;

@WebServlet("/core/dict")
public class SysDictServlet extends BaseServlet{

	/**
	 * 
	 */
	private static final long serialVersionUID = -168602221997633445L;
	
//	private SysDictService  sysDictService = (SysDictService) CacheManager.get("sysDictService");
//	private SysDictService  sysDictService = (SysDictService) Services.context.getBean("sysDictService");
	
	public void test(HttpServletRequest request, HttpServletResponse response) {
//		List<SysDict> list = sysDictService.findAllList();
//		for(SysDict dict : list) {
//			System.out.println("dict === "  + dict.getValue());
//		}
	}
	
	public void findAllList(HttpServletRequest request, HttpServletResponse response) {
		
		response.setCharacterEncoding("UTF-8");
		response.setContentType("application/json; charset=utf-8");
		try {
			PrintWriter out = response.getWriter();
//			List<String> list = sysDictService.findTypeList();
//			Map<String, Object> result = new HashMap<String, Object>();
//			result.put("result", list);
//			result.put("pageNo", "");
//			result.put("totalPages", value)
//			out.println(JSON.toJSONString(list));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
	
}
